package com.rongxun.hbwallet.mvp.contract;

import com.rongxun.base.IBase;
import com.rongxun.hbwallet.model.Response;
import com.rongxun.hbwallet.model.bean.Config;
import com.rongxun.hbwallet.model.bean.Order;
import com.rongxun.hbwallet.model.bean.Wallet;

import java.math.BigDecimal;
import java.math.BigInteger;

import io.reactivex.Flowable;

/**
 * 创建者     庄丰泽
 * 创建时间   2018/8/20 13:47
 * 描述	      转账充值
 */

public interface ITransfer {
    interface IView extends IBase.IView {
        void showEthBalance(BigDecimal ethBalance);

        void showTokenBalance(BigInteger cityBalance);

        void showTransferResult(String txHash);

        void showRechargeResult(String txHash);

        void showGasPrice(BigInteger gasPrice);

        void showGasLimit(BigInteger gasLimit);

        void showTransferInfo();


        void showRechargeMin(String rechargeMin);

        void showEthToToken(String ethToToken);

        void showRechargeSuccess(String txhash);

        void showAdminAdress(String adminAdress);
    }

    interface IPresenter extends IBase.IPresenter {
        void getEthBalance(String fromAddress);

        void getTokenBalance(String fromAddress);

        void getGasPrice();

        void getGasLimit(String fromAddress);

        void transfer(String password, String fromAddress, String toAddress, BigInteger amount, BigInteger gasLimit, BigInteger gasPrice);

        void recharge(String password, String fromAddress, String toAddress, BigDecimal amount, BigInteger gasLimit, BigInteger gasPrice);

        void checkTransferInfo(String address, String transfer, BigDecimal ethBalance, String gas, BigInteger tokenBalance);

        void getRechargeMin();//BFMC_RECHARGE_MIN

        void getEthToToken();//ETH_BFMC_EXCHANGE_RATE
        void getAdminAddress();//RECHARGE_ADDRESS

        void saveRecharge(String amount,
                          String fromaddress,
                          Double gas,
                          String toaddress,
                          String txhash,
                          String uid);

        //充值地址 充值的代币数量 最小代币数量 实际转入的eth gas eth余额
        void checkRechargeInfo(String address, String RechargeMoney, double minRecharge, BigDecimal realEth, String gas, BigDecimal ethBalance);

        void buy(String amount,
                 String fromaddress,
                 Double gas,
                 String toaddress,
                 String trxhash,
                 String uid);
    }

    interface IModel extends IBase.IModel {

        Flowable<Response<Config>> getTokenConfig(String key);

        Flowable<Response<Wallet>> saveRecharge(String amount,
                                                String fromaddress,
                                                Double gas,
                                                String toaddress,
                                                String txhash,
                                                String uid
        );

        Flowable<Response<Order>> buy(String amount,
                                      String fromaddress,
                                      Double gas,
                                      String toaddress,
                                      String trxhash,
                                      String uid);
    }
}
